# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[self._DBusProp__get = ref.method('__%s_get' % name, '', sig)
self._DBusProp__set = ref.method('__%s_set' % name, sig, '')
ref.inst.signal('__%s_notify' % name, sig, self._DBusProp__notify, WDB_AS_THREAD)
self._DBusProp__value = None
self._DBusProp__cb = None
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7770fac>}
nname: 35
n 35(None)[return self._DBusProp__value
]:
	i: 15(), 34()
	o: 

nname: 34
n 34(None)[]:
	i: 0(f)
	o: 35()

nname: 15
n 15(None)[self._DBusProp__value = self._DBusProp__get()
]:
	i: 0(t)
	o: 35()

nname: 0
n 0(self._DBusProp__value is None)[]:
	i: 
	o: 15(t), 34(f)

nname: 0
n 0(None)[if self._DBusProp__value is None:
	self._DBusProp__value = self._DBusProp__get()
return self._DBusProp__value
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7770d0c>}
nname: 0
n 0(None)[self._DBusProp__set(value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7770ccc>}
nname: 0
n 0(None)[self._DBusProp__cb = cb
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7770c2c>}
nname: 42
n 42(None)[return None
]:
	i: 24(), 41()
	o: 

nname: 41
n 41(None)[]:
	i: 0(f)
	o: 42()

nname: 24
n 24(None)[self._DBusProp__cb(value)
]:
	i: 0(t)
	o: 42()

nname: 0
n 0(self._DBusProp__cb is not None)[self._DBusProp__value = value
]:
	i: 
	o: 24(t), 41(f)

nname: 0
n 0(None)[self._DBusProp__value = value
if self._DBusProp__cb is not None:
	self._DBusProp__cb(value)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7770c8c>}
nname: 6
n 6(None)[def __init__(self, ref, name, sig):
	self._DBusProp__get = ref.method('__%s_get' % name, '', sig)
	self._DBusProp__set = ref.method('__%s_set' % name, sig, '')
	ref.inst.signal('__%s_notify' % name, sig, self._DBusProp__notify, WDB_AS_THREAD)
	self._DBusProp__value = None
	self._DBusProp__cb = None
	return None

def get(self):
	if self._DBusProp__value is None:
		self._DBusProp__value = self._DBusProp__get()
	return self._DBusProp__value

def set(self, value):
	self._DBusProp__set(value)

def set_notify(self, cb):
	self._DBusProp__cb = cb

def _DBusProp__notify(self, value):
	self._DBusProp__value = value
	if self._DBusProp__cb is not None:
		self._DBusProp__cb(value)
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb77707ac>}
nname: 6
n 6(None)[]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb77703cc>}
nname: 0
n 0(None)[self.bus = WyDbus()
self.props = {}
self.wyplayer = self.bus.reference(name, path)
self._init_root_()
self.wyplayer.media = self.bus.reference(name, path + '/Media')
self._init_media_()
self.wyplayer.playback = self.bus.reference(name, path + '/Playback')
self._init_playback_()
self.wyplayer.record = self.bus.reference(name, path + '/Record')
self._init_record_()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7775bec>}
nname: 0
n 0(None)[wpl = self.wyplayer
wpl.open = wpl.method('open', 's', '')
wpl.close = wpl.method('close', '', '')
wpl.exit = wpl.method('exit', '', '')
wpl.set_aopts = wpl.method('set_aopts', 's', '')
wpl.set_vopts = wpl.method('set_vopts', 's', '')
wpl.set_sopts = wpl.method('set_sopts', 's', '')
wpl.set_dopts = wpl.method('set_dopts', 's', '')
wpl.inst = self.bus.instance(wpl._path)
self.props['status'] = DBusProp(wpl, 'status', 's')
self.props['log_level'] = DBusProp(wpl, 'log_level', 'u')
self.props['exception'] = DBusProp(wpl, 'exception', 's')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb77757cc>}
nname: 0
n 0(None)[media = self.wyplayer.media
media.load = media.method('load', 'sa{ss}', '')
media.flush = media.method('flush', '', '')
media.alist = media.method('alist', '', 'a(isisii)')
media.vlist = media.method('vlist', '', 'a(isiiid)')
media.slist = media.method('slist', '', 'a(iss)')
media.inst = self.bus.instance(media._path)
self.props['uri'] = DBusProp(media, 'uri', 's')
self.props['container'] = DBusProp(media, 'container', 's')
self.props['duration'] = DBusProp(media, 'duration', 't')
self.props['scrambled'] = DBusProp(media, 'scrambled', 'b')
self.props['aid'] = DBusProp(media, 'aid', 'i')
self.props['vid'] = DBusProp(media, 'vid', 'i')
self.props['sid'] = DBusProp(media, 'sid', 'i')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7775cec>}
nname: 0
n 0(None)[plb = self.wyplayer.playback
plb.pos = plb.method('pos', 'bbii', 'ad')
plb.play = plb.method('play', 'db', '')
plb.stop = plb.method('stop', '', '')
plb.seek = plb.method('seek', 'd', '')
plb.inst = self.bus.instance(plb._path)
self.props['speed'] = DBusProp(plb, 'speed', 'd')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7775aac>}
nname: 0
n 0(None)[rec = self.wyplayer.record
rec.new = rec.method('new', 's', 's')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7770d2c>}
nname: 6
n 6(None)[def __init__(self, name='com.wyplay.wyplayer', path='/com/wyplay/WyPlayer'):
	self.bus = WyDbus()
	self.props = {}
	self.wyplayer = self.bus.reference(name, path)
	self._init_root_()
	self.wyplayer.media = self.bus.reference(name, path + '/Media')
	self._init_media_()
	self.wyplayer.playback = self.bus.reference(name, path + '/Playback')
	self._init_playback_()
	self.wyplayer.record = self.bus.reference(name, path + '/Record')
	self._init_record_()

def _init_root_(self):
	wpl = self.wyplayer
	wpl.open = wpl.method('open', 's', '')
	wpl.close = wpl.method('close', '', '')
	wpl.exit = wpl.method('exit', '', '')
	wpl.set_aopts = wpl.method('set_aopts', 's', '')
	wpl.set_vopts = wpl.method('set_vopts', 's', '')
	wpl.set_sopts = wpl.method('set_sopts', 's', '')
	wpl.set_dopts = wpl.method('set_dopts', 's', '')
	wpl.inst = self.bus.instance(wpl._path)
	self.props['status'] = DBusProp(wpl, 'status', 's')
	self.props['log_level'] = DBusProp(wpl, 'log_level', 'u')
	self.props['exception'] = DBusProp(wpl, 'exception', 's')

def _init_media_(self):
	media = self.wyplayer.media
	media.load = media.method('load', 'sa{ss}', '')
	media.flush = media.method('flush', '', '')
	media.alist = media.method('alist', '', 'a(isisii)')
	media.vlist = media.method('vlist', '', 'a(isiiid)')
	media.slist = media.method('slist', '', 'a(iss)')
	media.inst = self.bus.instance(media._path)
	self.props['uri'] = DBusProp(media, 'uri', 's')
	self.props['container'] = DBusProp(media, 'container', 's')
	self.props['duration'] = DBusProp(media, 'duration', 't')
	self.props['scrambled'] = DBusProp(media, 'scrambled', 'b')
	self.props['aid'] = DBusProp(media, 'aid', 'i')
	self.props['vid'] = DBusProp(media, 'vid', 'i')
	self.props['sid'] = DBusProp(media, 'sid', 'i')

def _init_playback_(self):
	plb = self.wyplayer.playback
	plb.pos = plb.method('pos', 'bbii', 'ad')
	plb.play = plb.method('play', 'db', '')
	plb.stop = plb.method('stop', '', '')
	plb.seek = plb.method('seek', 'd', '')
	plb.inst = self.bus.instance(plb._path)
	self.props['speed'] = DBusProp(plb, 'speed', 'd')

def _init_record_(self):
	rec = self.wyplayer.record
	rec.new = rec.method('new', 's', 's')

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7770d0c>}
nname: 0
n 0(None)[from wydbus import WyDbus, WDB_AS_THREAD
class DBusProp(object):
	def __init__(self, ref, name, sig):
		self._DBusProp__get = ref.method('__%s_get' % name, '', sig)
		self._DBusProp__set = ref.method('__%s_set' % name, sig, '')
		ref.inst.signal('__%s_notify' % name, sig, self._DBusProp__notify, WDB_AS_THREAD)
		self._DBusProp__value = None
		self._DBusProp__cb = None
		return None

	def get(self):
		if self._DBusProp__value is None:
			self._DBusProp__value = self._DBusProp__get()
		return self._DBusProp__value

	def set(self, value):
		self._DBusProp__set(value)

	def set_notify(self, cb):
		self._DBusProp__cb = cb

	def _DBusProp__notify(self, value):
		self._DBusProp__value = value
		if self._DBusProp__cb is not None:
			self._DBusProp__cb(value)
		return None



class RecordProxy(object):
	pass

class WyPlayerProxy(object):
	def __init__(self, name='com.wyplay.wyplayer', path='/com/wyplay/WyPlayer'):
		self.bus = WyDbus()
		self.props = {}
		self.wyplayer = self.bus.reference(name, path)
		self._init_root_()
		self.wyplayer.media = self.bus.reference(name, path + '/Media')
		self._init_media_()
		self.wyplayer.playback = self.bus.reference(name, path + '/Playback')
		self._init_playback_()
		self.wyplayer.record = self.bus.reference(name, path + '/Record')
		self._init_record_()

	def _init_root_(self):
		wpl = self.wyplayer
		wpl.open = wpl.method('open', 's', '')
		wpl.close = wpl.method('close', '', '')
		wpl.exit = wpl.method('exit', '', '')
		wpl.set_aopts = wpl.method('set_aopts', 's', '')
		wpl.set_vopts = wpl.method('set_vopts', 's', '')
		wpl.set_sopts = wpl.method('set_sopts', 's', '')
		wpl.set_dopts = wpl.method('set_dopts', 's', '')
		wpl.inst = self.bus.instance(wpl._path)
		self.props['status'] = DBusProp(wpl, 'status', 's')
		self.props['log_level'] = DBusProp(wpl, 'log_level', 'u')
		self.props['exception'] = DBusProp(wpl, 'exception', 's')

	def _init_media_(self):
		media = self.wyplayer.media
		media.load = media.method('load', 'sa{ss}', '')
		media.flush = media.method('flush', '', '')
		media.alist = media.method('alist', '', 'a(isisii)')
		media.vlist = media.method('vlist', '', 'a(isiiid)')
		media.slist = media.method('slist', '', 'a(iss)')
		media.inst = self.bus.instance(media._path)
		self.props['uri'] = DBusProp(media, 'uri', 's')
		self.props['container'] = DBusProp(media, 'container', 's')
		self.props['duration'] = DBusProp(media, 'duration', 't')
		self.props['scrambled'] = DBusProp(media, 'scrambled', 'b')
		self.props['aid'] = DBusProp(media, 'aid', 'i')
		self.props['vid'] = DBusProp(media, 'vid', 'i')
		self.props['sid'] = DBusProp(media, 'sid', 'i')

	def _init_playback_(self):
		plb = self.wyplayer.playback
		plb.pos = plb.method('pos', 'bbii', 'ad')
		plb.play = plb.method('play', 'db', '')
		plb.stop = plb.method('stop', '', '')
		plb.seek = plb.method('seek', 'd', '')
		plb.inst = self.bus.instance(plb._path)
		self.props['speed'] = DBusProp(plb, 'speed', 'd')

	def _init_record_(self):
		rec = self.wyplayer.record
		rec.new = rec.method('new', 's', 's')



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7769fac>}
from wydbus import WyDbus, WDB_AS_THREAD
class DBusProp(object):
	def __init__(self, ref, name, sig):
		self._DBusProp__get = ref.method('__%s_get' % name, '', sig)
		self._DBusProp__set = ref.method('__%s_set' % name, sig, '')
		ref.inst.signal('__%s_notify' % name, sig, self._DBusProp__notify, WDB_AS_THREAD)
		self._DBusProp__value = None
		self._DBusProp__cb = None
		return None

	def get(self):
		if self._DBusProp__value is None:
			self._DBusProp__value = self._DBusProp__get()
		return self._DBusProp__value

	def set(self, value):
		self._DBusProp__set(value)

	def set_notify(self, cb):
		self._DBusProp__cb = cb

	def _DBusProp__notify(self, value):
		self._DBusProp__value = value
		if self._DBusProp__cb is not None:
			self._DBusProp__cb(value)
		return None



class RecordProxy(object):
	pass

class WyPlayerProxy(object):
	def __init__(self, name='com.wyplay.wyplayer', path='/com/wyplay/WyPlayer'):
		self.bus = WyDbus()
		self.props = {}
		self.wyplayer = self.bus.reference(name, path)
		self._init_root_()
		self.wyplayer.media = self.bus.reference(name, path + '/Media')
		self._init_media_()
		self.wyplayer.playback = self.bus.reference(name, path + '/Playback')
		self._init_playback_()
		self.wyplayer.record = self.bus.reference(name, path + '/Record')
		self._init_record_()

	def _init_root_(self):
		wpl = self.wyplayer
		wpl.open = wpl.method('open', 's', '')
		wpl.close = wpl.method('close', '', '')
		wpl.exit = wpl.method('exit', '', '')
		wpl.set_aopts = wpl.method('set_aopts', 's', '')
		wpl.set_vopts = wpl.method('set_vopts', 's', '')
		wpl.set_sopts = wpl.method('set_sopts', 's', '')
		wpl.set_dopts = wpl.method('set_dopts', 's', '')
		wpl.inst = self.bus.instance(wpl._path)
		self.props['status'] = DBusProp(wpl, 'status', 's')
		self.props['log_level'] = DBusProp(wpl, 'log_level', 'u')
		self.props['exception'] = DBusProp(wpl, 'exception', 's')

	def _init_media_(self):
		media = self.wyplayer.media
		media.load = media.method('load', 'sa{ss}', '')
		media.flush = media.method('flush', '', '')
		media.alist = media.method('alist', '', 'a(isisii)')
		media.vlist = media.method('vlist', '', 'a(isiiid)')
		media.slist = media.method('slist', '', 'a(iss)')
		media.inst = self.bus.instance(media._path)
		self.props['uri'] = DBusProp(media, 'uri', 's')
		self.props['container'] = DBusProp(media, 'container', 's')
		self.props['duration'] = DBusProp(media, 'duration', 't')
		self.props['scrambled'] = DBusProp(media, 'scrambled', 'b')
		self.props['aid'] = DBusProp(media, 'aid', 'i')
		self.props['vid'] = DBusProp(media, 'vid', 'i')
		self.props['sid'] = DBusProp(media, 'sid', 'i')

	def _init_playback_(self):
		plb = self.wyplayer.playback
		plb.pos = plb.method('pos', 'bbii', 'ad')
		plb.play = plb.method('play', 'db', '')
		plb.stop = plb.method('stop', '', '')
		plb.seek = plb.method('seek', 'd', '')
		plb.inst = self.bus.instance(plb._path)
		self.props['speed'] = DBusProp(plb, 'speed', 'd')

	def _init_record_(self):
		rec = self.wyplayer.record
		rec.new = rec.method('new', 's', 's')



